<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录界面</title>
    <style type="text/css">
        img,input,select{
            vertical-align: middle;
        }
    </style>
</head>
<body>
        <h3>用户登录</h3>
        <form action="login" method="post" enctype="application/x-www-form-urlencoded">
            <input type="text" name="username" placeholder="请输入用户名"/><br>
            <input type="password" name="password" placeholder="请输入密码"/><br>
           <input type="text" name="vcode"><img id="img" src="code" height="25" onclick="changeImg()"><br/>
            <input type="submit" value="登录"/>
        </form>

        <script type="text/javascript">
            function changeImg() {
                var img = document.getElementById("img");
                img.src="code?n="+Math.random();
            }
        </script>
</body>
</html>